package com.example.demo.services.imp;


import com.example.demo.entity.ReportGli;
import com.example.demo.entity.teacher;
import com.example.demo.entity.userAdd;
import com.example.demo.mapper.ReportMapper;
import com.example.demo.mapper.userSec;
import com.example.demo.mapper.userSecMapper;
import com.example.demo.services.userSecServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Service
public class userSecSerImp implements userSecServices {


    @Autowired
    private userSec userSec;


    @Autowired
    private userSecMapper userSecMapper;


    @Autowired
    private ReportMapper reportMapper;

    @Override
    public Integer adduserSec(String id, String life, Integer age, String telephone, LocalDateTime creatime,String teacher,Integer teacherId) {
        return userSec.adduserSec(id, life, age, telephone, creatime,teacher,teacherId);
    }

    @Override
    public List<userAdd> selectall(Integer teacherId) {
        return userSec.selectall(teacherId);
    }

    @Override
    public userAdd selectUser(String userId) {
        return userSec.selectUser(userId);
    }

    @Override
    public Integer updateUser(com.example.demo.entity.userSec userSe) {
        return userSecMapper.updateUser(userSe);
    }

    @Override
    public List<userAdd> selectAll() {
        return userSec.selectAll();
    }

    @Override
    public Integer updateSec(String id, String name, String lifeCity, String loginName, String password) {
        return userSec.updateSec(id, name, lifeCity, loginName, password);
    }

    @Override
    public List<ReportGli> selectAllGli() {
        return reportMapper.selectGli();
    }

    @Override
    public List<teacher> selectTeacher() {
        return userSecMapper.selectTeacher();
    }

    @Override
    public Integer updateTeacher(String userId, Integer teacherId) {
        return userSecMapper.updateLeader(userId, teacherId);
    }


}
